package com.maimao.spider.controller;

import com.maimao.spider.task.BrandTask;
import com.maimao.spider.task.CategoryTask;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.atomic.AtomicInteger;

/**
 * @author MaoLin Wang
 * @date 2020/11/24 10:09 上午
 */
@RequestMapping("/spider")
@Controller
public class SpiderController {
    @Autowired
    private CategoryTask categoryTask;

    @Autowired
    private BrandTask brandTask;
    public static AtomicInteger count = new AtomicInteger(1);

    @GetMapping("/cate")
    @ResponseBody
    public String doCate() {
        categoryTask.spideCate();
        return "ok";
    }

    @GetMapping("/brand")
    @ResponseBody
    public String doBrand() {
        brandTask.spiderBrand();
        return "ok";
    }


    @GetMapping("/html")
    public String html() {
        //categoryTask.spideCate();
        return "cate";
    }


}
